
obj-m += rpi_radar.o

ARCH = arm
CROSS_COMPILE = $(HOME)/rpi/tools-master/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
DTC = $(HOME)/rpi/linux-rpi-4.14.y/scripts/dtc/dtc

KDIR = $(HOME)/rpi/linux-rpi-4.14.y

all:
	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) modules

rpi_radar_overlay.dtbo: rpi_radar.dts
	$(DTC) -@ -H epapr -I dts -O dtb $^ -o $@

rpi: rpi.c
	$(CROSS_COMPILE)gcc $^ -o $@

clean:
	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) clean
	@rm -f *.o rpi *.dtbo
